<?php
/**
 * Created by PhpStorm.
 * User: Antique
 * Date: 2021/11/30
 * Time: 下午 07:45
 */

namespace work\core;

require 'class1_father.php';

class class1 extends class1_father
{

    public function __construct()
    {
        echo '父类的构造函数重写成功';
        echo '<br />';
        parent::__construct();
        echo '<br />';
    }

    public function test1()
    {
        echo '公开方法执行成功';
        echo '<br />';
        $this->class1_father_();
        parent::class1_father_();
        echo '<br />';
        $this->father_test1();
        echo '<br />';
        $this->static_class1();
        echo '<br />';
    }


    protected function test2()
    {
        echo '受保护的方法执行成功';
        echo '<br />';
    }

    private function test3()
    {
        echo '私有的方法执行成功';
        echo '<br />';
    }

    protected function father_test1()
    {
        echo '父类里的father_test1方法被重写了';
        echo '<br />';
    }
    static  function static_class1(){
echo '这是class1里的静态类';
echo '<br />';
    }


    public function __destruct()
    {
        echo '父类的析构函数重写成功';
        echo '<br />';
        parent::__destruct();
        echo '<br />';
    }
}